// hdu5469
// unsolved
// 这个问题可以树分治+hash搞定，这个写的是从每个叶子结点建立大trie导出
// 广义后缀自动机，可能不够复杂度。时空。
// run: time $exec < input
#include <algorithm>
#include <cstdio>
#include <cstring>

int const alpha_size = 26;
int const maxn = 10100;
int head[maxn], next[2 * maxn], end_point[2 * maxn];
int alloc;

struct state
{
	int len;
	state * link, * child[(alpha_size+4)];
} sam_state[maxn * 23], * sam_head; // 3*O(n) space requied

int sam_alloc;

struct trie
{
	trie * child[alpha_size];
} trie_node[maxn * (alpha_size+4)], * trie_head;

int trie_alloc;

char color[maxn];
int degree[maxn];
bool vis[maxn];
int n, len;
char str[maxn];

void add_edge(int u, int v)
{
	end_point[alloc] = v; next[alloc] = head[u]; head[u] = alloc++;
	end_point[alloc] = u; next[alloc] = head[v]; head[v] = alloc++;
	degree[u]++; degree[v]++;
}

trie * trie_node_alloc()
{
	trie * tmp = trie_node + trie_alloc++;
	return tmp;
}

void build_trie(trie * now, int u)
{
	int index = color[u] - 'a';
	if (!now->child[index])
		now->child[index] = trie_node_alloc();
	now = now->child[index];
	vis[u] = true;
	for (int p = head[u]; p; p = next[p])
		if (!vis[end_point[p]])
			build_trie(now, end_point[p]);
	vis[u] = false;
}

state * sam_state_alloc()
{
	state * tmp = sam_state + sam_alloc++;
	return tmp;
}

state * sam_extend(state * last, int x)
{
	state * cur = sam_state_alloc();
	cur->len = last->len + 1;
	state * p;
	for (p = last; p && !p->child[x]; p = p->link)
		p->child[x] = cur;
	if (!p) cur->link = sam_head;
	else {
		state * q = p->child[x];
		if (p->len + 1 == q->len)
			cur->link = q;
		else {
			state * clone = sam_state_alloc();
			*clone = *q;
			clone->len = p->len + 1;

			for (; p && p->child[x] == q; p = p->link)
				p->child[x] = clone;
			q->link = cur->link = clone;
		}
	}
	return cur;
}

void build_sam(state * now, trie * t)
{
	for (int i = 0; i < alpha_size; i++)
		if (t->child[i]) {
			state * tmp = sam_extend(now, i);
			build_sam(tmp, t->child[i]);
		}
}

void init()
{
	/*
	std::memset(head, 0, sizeof(head));
	std::memset(degree, 0, sizeof(degree));
	std::memset(sam_state, 0, sizeof(sam_state));
	std::memset(trie_node, 0, sizeof(trie_node));
	*/
	std::memset(head, 0, sizeof(int) * n);
	std::memset(degree, 0, sizeof(int) * n);
	std::memset(sam_state, 0, sizeof(state) * (sam_alloc + 4));
	std::memset(trie_node, 0, sizeof(trie) * (trie_alloc + 4));
	alloc = trie_alloc = sam_alloc = 1;
}

bool sam_search()
{
	state * ts = sam_head;
	for (int i = 0; i < len; i++) {
		int t = str[i] - 'a';
		if (ts->child[t]) ts = ts->child[t];
		else return false;
	}
	return true;
}

int main()
{
	int T; std::scanf("%d", &T);
	for (int ti = 1; ti <= T; ti++) {
		std::printf("Case #%d: ", ti);
		init();
		std::scanf("%d", &n);
		for (int i = 1, x, y; i < n; i++) {
			std::scanf("%d %d", &x, &y);
			add_edge(--x, --y);
		}
		std::scanf("%s", color);

		trie_head = trie_node_alloc();
		for (int i = 0; i < n; i++) {
			if (degree[i] == 1) build_trie(trie_head, i);
		}

		sam_head = sam_state_alloc();
		build_sam(sam_head, trie_head);

		std::scanf("%s", str);
		len = std::strlen(str);

		if (sam_search()) {
			std::printf("Find\n");
		} else {
			for (int i = 0; i < len / 2; i++) std::swap(str[i], str[len - 1 - i]);
			if (sam_search())
				std::printf("Find\n");
			else
				std::printf("Impossible\n");
		}
	}
}

